import ReactDom from "react-dom";
import React from "react";
import {hashHistory, Router, Route, IndexRoute} from "react-router";
import App from "./pages/app";
import Dashboard from "./pages/dashboard";
import User from "./pages/user";
import UserEdit from "./pages/user/edit";
import News from "./pages/news";
import NewsPost from "./pages/news/post";
import Prize from "./pages/prize";
import PrizePost from "./pages/prize/post";
import PrizeWins from "./pages/prize/wins";
//文章页
const route = (
    <Router history={hashHistory}>
        <Route path="/" component={App}>
            <IndexRoute component={Dashboard}/>
            <Route path="user" component={User}/>
            <Route path="user/:openid/edit" component={UserEdit}/>
            <Route path="news" component={News}/>
            <Route path="news/:newsId/post" component={NewsPost}/>
            <Route path="news/post" component={NewsPost}/>
            <Route path="prize" component={Prize}/>
            <Route path="prize/post" component={PrizePost}/>
            <Route path="prize/:id/post" component={PrizePost}/>
            <Route path="prize/wins" component={PrizeWins}/>
        </Route>
    </Router>
);
ReactDom.render(route, document.querySelector('#content'));